home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n16.arc / DIRANY.BAT < prev    next >
DOS Batch File  |  1991-08-27  |  741b  |  31 lines

  1. @ECHO OFF
  2. IF '%1'=='' GOTO syntax
  3. SET N=
  4. CALL GETLEN %1
  5. SET temp=%1*.*
  6. IF %N%==8 GOTO doit
  7. SET temp=%temp% ?%1*.*
  8. IF %N%==7 GOTO doit
  9. SET temp=%temp% ??%1*.*
  10. IF %N%==6 GOTO doit
  11. SET temp=%temp% ???%1*.*
  12. IF %N%==5 GOTO doit
  13. SET temp=%temp% ????%1*.*
  14. IF %N%==4 GOTO doit
  15. SET temp=%temp% ?????%1*.* *.%1*
  16. IF %N%==3 GOTO doit
  17. SET temp=%temp% ??????%1*.* *.?%1*
  18. IF %N%==2 GOTO doit
  19. SET temp=%temp% ???????%1.* *.??%1
  20. :doit
  21. FOR %%f IN (%temp%) DO ECHO %%f
  22. SET temp=
  23. SET N=
  24. GOTO end
  25. :syntax
  26. ECHO DIRANY lists files whose names _contain_ a certain string.
  27. ECHO                Syntax: "DIRANY string n"
  28. ECHO where "string" is a string of 1 to 8 characters (no wildcards)
  29. ECHO and "n" is the length of that string.
  30. :end
  31.